#define  _CRT_SECURE_NO_WARNINGS

#include<stdio.h>
#include<string.h>


int main()
{
    char arr[100] = { 0 }, temp[] = "10x98765432", str[100] = { 0 };
    scanf("%s", arr);
    int len = strlen(arr), i = 0, a[] = { 7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2 }, sum = 0, j = 0, x = 0;
    for (i = 0; i < 6; i++)
    {
        str[i] = arr[i];
    }
    str[6] = '1';
    str[7] = '9';
    for (i = 8, j = 6; j < len; i++, j++)
    {
        str[i] = arr[j];
    }
    for (i = 0; i < 17; i++)
    {
        x = str[i] - '0';
        sum += x * a[i];
        printf("%c", str[i]);
    }
    printf("%c", temp[sum % 11]);

    return 0;
}